<% render_spedific_sidebar(render :partial=>"novel_read_sidebar") %>
<div>
    <h3><%= @novel.title %></h3>

    <p class="title_line">发起者:<%= link_to @novel.user.name, :controller=>"user", :action=>"show", :id=>@novel.user %><%= time_format @novel.created_at %></p>

    <p><%= simple_format @novel.summary %></p>

    <p>续写进度：<strong><%= @novel.fragment_number %></strong></p>

    <p>关键字：<%= @novel.tags %></p>

    <p><%= link_to ">>回续写页面", :controller=>"novel", :action=>"show", :id=>@novel %></p>
</div>
<div style="display:none" id="write_fragment">
    <%= render :partial=>"fragment/fragment_form", :object=>@novel %>
</div>
<%= button_to ">>就地续写", :url =>{ :action => :toogle_write },:remote=>true if @novel.is_open %>
<!--default display in Positive order-->
<p><%= button_to_function "切换阅读顺序", :onclick=>"sortNovelContent()"%></p>
<div id="novel_content">
    <% if @fragments and !@fragments.empty?
    %>
        <%
           @fragments.each do |fragment|
        %>
            <span class="item">
                <p class="title_line"><%= fragment.fragment_number+1 -%></p>
                <%= simple_format(fragment.content) -%>
            </span>
        <%
           end
           else
        %>
        <h5>还没有任何被接受的续写！<%= link_to ">>我去续写", :controller=>"novel", :action=>"show", :id=>@novel %></h5>
    <%
       end
    %>
</div>
